{% extends 'layout.html' %}

{% block main %}
<ol class="breadcrumb">
	<li><a href="#">管理首页</a></li>
	<li><span>内容列表</span></li>
</ol>
<h3>内容列表</h3>

<table class="table table-hover table-striped table-bordered">
	<thead>
		<tr>
			<th>ID</th>
			<th>分类名称</th>
			<th>标题</th>
			<th>作者</th>
			<th>添加时间</th>
			<th>浏览量</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		{% for content in contents %}
		<tr>
			<td>{{content.id}}</td>
			<td>{{content.category.name}}</td>
			<td>{{content.title}}</td>
			<td>{{content.author}}</td>
			<td>{{content.addDat |date('Y年m月d日 H:i:s',-8*60)}}</td>
			<td>{{content.views}}</td>
			<td>
				<a href="/admin/content/edit?id={{content.id}}">修改</a> | 
				<a href="/admin/content/delete?id={{content.id}}">删除</a>
			</td>
		</tr>
		{% endfor %}
	</tbody>
</table>

{% include 'page.html' %}	

{% endblock %}